package cn.school.mybatis.service;

import cn.school.mybatis.dao.GradeDao;
import cn.school.mybatis.pojo.Grade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//业务逻辑bean
//服务层,调用dao方法
@Service
public class GradeService {

//    public final static GradeService GRADE_SERVICE = new GradeService();
        @Autowired
    private GradeDao gradeDao;

//增加
public int add(Grade grade) {
        return gradeDao.add(grade);
}
//删除
public int del(int id) {
        return gradeDao.del(id);
}
//修改
public int update(Grade grade) {

        return gradeDao.update(grade);

}
//id查单个
public Grade get(int id) {
        return gradeDao.get(id);
}


//查全部
public List<Grade> searchAll() {
        return gradeDao.searchAll();
}




}
